grammar debugMeWithAntlrWorks;
 options{backtrack=true; memoize=true;} 



parse :
	 result=ruleDModel
	 // Always return the root node! This prevents that this method is called multiple times
	 // with interesting side effects.
	 EOF
;

ruleDModel 

:
(('ui')

(':')

( RULE_STRING
)

('domain')

(':')

( RULE_STRING
)

('->')

(RULE_ID
)

(ruleDBinding)*
)
;

ruleDBinding 
:
        temp_dcontrolbinding=ruleDControlBinding 	|        temp_dtemplatebinding=ruleDTemplateBinding 	;

ruleDControlBinding 

:
(('bind')

(RULE_ID
)

('to')

(rulePathElement)

(('match')

(ruleValidator)
)?
)
;

ruleDTemplateBinding 

:
(('bind')

('(')

(RULE_ID
)

(')')

(RULE_ID
)

('to')

(rulePathElement)

(('match')

(ruleValidator)
)?
)
;

rulePathElement 

:
((RULE_ID
)

(('.')

(rulePathElement)
)?
)
;

ruleValidator 
:
        temp_concretevalidator=ruleConcreteValidator 	;

ruleConcreteValidator 
:
        temp_patternvalidator=rulePatternValidator 	;

rulePatternValidator 

:
(('pattern')

(RULE_STRING)

(('warning')
	|
('error')
)

(':')

(RULE_STRING)
)
;

RULE_ID :

	 ('^')?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*
	 
;

RULE_STRING :

	 '\"' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'\"') )* '\"' |
	 '\'' ( '\\' ('b'|'t'|'n'|'f'|'r'|'\"'|'\''|'\\') | ~('\\'|'\'') )* '\''
	 
;

RULE_INT :

	 ('-')?('0'..'9')+
	 
;

RULE_WS :

	 (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;}
	 
;

RULE_ML_COMMENT :

	 '/*' ( options {greedy=false;} : . )* '*/' {$channel=HIDDEN;}
	 
;

RULE_SL_COMMENT :

	 '//' ~('\n'|'\r')* '\r'? '\n' {$channel=HIDDEN;}
	 
;

